import java.lang.reflect.Field;

/**
 * @author 汤奇
 * @version V1.0
 * @Project BookPro
 * @Package PACKAGE_NAME
 * @Description:
 * @Date 2022/7/25 18:31
 */
public class Test02 {

    static {
        //搞破坏
        //说明: 1.装箱用的是valueOf方法
        //          2.缓存是一个数组
        Field cache = null;
        Class<?> clazz = Integer.class.getDeclaredClasses()[0];
        try {
            cache = clazz.getDeclaredField("cache");
        } catch (NoSuchFieldException e) {
            e.printStackTrace();
        }

        assert cache != null;
        cache.setAccessible(true);

        Integer[] cacheArr = new Integer[0];
        try {
            cacheArr = (Integer[]) cache.get(null);
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        cacheArr[128] = 10000;
    }
    public static void main(String[] args) {
        Integer a = 0;
        //10000
        System.out.println(a);
    }

    /**
     * 单向链表的节点定义
     * @param <T>
     */
    static class Node<T>{
        T value;
        Node<T> next;
    }
}
